<?php
	session_start();
	require_once '../connection.php';
	
	if (!isset($_SESSION['uid']))
			die (json_encode (array ('message'=>'Du må være pålogget for å gjøre dette!')));
			
	$sql = 'INSERT INTO proposition (rid, uid, price, worktime, note, hired, requestTitle, addedDate) VALUES (?, ?, ?, ?, ?, ?, ?, now())';
	
	$sth = $db->prepare ($sql);
	//-2 skal byttes ut med requestIDen/anbudIDen
	$sth->execute (array ($_POST['rid'], $_SESSION['uid'], $_POST['price'], $_POST['worktime'], $_POST['note'], "no", $_POST['requestTitle'])); //$_SESSION['user']

	echo json_encode (array ('ok'=>'OK'));
?>